diff options
author | 2022-01-04 09:10:27 -0800 | |
---|---|---|
committer | 2022-01-04 09:10:27 -0800 | |
commit | c80c7f677c8ba42efdbd399fd5bf9cf3c191856f (patch) | |
tree | 2717023bee33648b913a2d1a40f16776c1692814 /docs/src/pages/[...slug].astro | |
parent | e5019271a5b549a3a0b7a8b92bf919f2572a78c4 (diff) | |
download | astro-c80c7f677c8ba42efdbd399fd5bf9cf3c191856f.tar.gz astro-c80c7f677c8ba42efdbd399fd5bf9cf3c191856f.tar.zst astro-c80c7f677c8ba42efdbd399fd5bf9cf3c191856f.zip |
Rename [slug].astro to [...slug].astro (#2306)
Diffstat (limited to 'docs/src/pages/[...slug].astro')
-rw-r--r-- | docs/src/pages/[...slug].astro | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/src/pages/[...slug].astro b/docs/src/pages/[...slug].astro new file mode 100644 index 000000000..613e2b3d5 --- /dev/null +++ b/docs/src/pages/[...slug].astro @@ -0,0 +1,19 @@ +--- +export async function getStaticPaths() { + // get english pages that moved from `/` to `/en/` + const englishPages = Astro.fetchContent('./en/**/*.md'); + + // add pages that are `*.astro` files as well + const otherPages = [{ url: "/en/themes" }]; + return [...englishPages, ...otherPages].map((page) => ({ + params: { + slug: page.url.slice(4), + }, + props: { + englishSlug: page.url, + } + })); +} +--- + +<meta http-equiv="refresh" content={`0;url=${Astro.props.englishSlug}`} /> |